package day13.KeJian;

import java.io.*;

public class BufferedStreamDemo02 {
    public static void main(String[] args) throws IOException {
        //创建字符缓冲输出流
        BufferedWriter bw = new BufferedWriter(new FileWriter("D://itheima//nb.txt"));

        //写数据
        for (int i = 0; i < 10; i++) {
            bw.write("hell0"+i);
            bw.newLine();
            bw.flush();
            
        }
        //释放资源
        bw.close();
        //创建字符缓冲输入流
        BufferedReader br = new BufferedReader(new FileReader("D://itheima//nb.txt"));
        String line;
        while ((line=br.readLine())!=null){
            System.out.println(line);
        }
        br.close();
    }
}
